#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    this->hide();
    add_main = new add;
    connect(add_main, SIGNAL(sendsignal()),  this, SLOT(reshow()));
    add_main->show();
}

void MainWindow::on_pushButton_2_clicked()
{
    this->hide();
    sub_main = new sub;
    connect(sub_main, SIGNAL(sendsignal()),  this, SLOT(reshow()));
    sub_main->show();
}

void MainWindow::on_pushButton_3_clicked()
{
    this->hide();
    mul_main = new mul;
    connect(mul_main, SIGNAL(sendsignal()),  this, SLOT(reshow()));
    mul_main->show();
}

void MainWindow::on_pushButton_4_clicked()
{
    this->hide();
    div_main = new div_;
    connect(div_main, SIGNAL(sendsignal()),  this, SLOT(reshow()));
    div_main->show();
}

void MainWindow::on_pushButton_5_clicked()
{
    this->hide();
    add_sub_main = new add_sub;
    connect(add_sub_main, SIGNAL(sendsignal()),  this, SLOT(reshow()));
    add_sub_main->show();
}

void MainWindow::on_pushButton_6_clicked()
{
    this->hide();
    mul_div_main = new mul_div;
    connect(mul_div_main, SIGNAL(sendsignal()),  this, SLOT(reshow()));
    mul_div_main->show();
}


void MainWindow::reshow()
{
    this->show();
}

